<?php
$this->pageTitle = 'View Comments';
$this->breadcrumbs=array(
	'Comments'=>array('index'),
	$model->comment_id,
);
?>
<div class="heading">
    <h1><img src="<?php echo ShortUtil::themePath() ?>/images/default.png" />View Comment #<?php echo $model->comment_id; ?></h1>
    <div class="controls"> 
        <?php
        if (isset($_GET['ajax'])) {
            echo CHtml::button('Create', array('class' => 'controls', 'onclick' => "location.href='" . $this->createUrl('create', array('ajax' => true)) . "'"));
            echo CHtml::button('Update', array('class' => 'controls', 'onclick' => "location.href='" . $this->createUrl('update', array('id' => $model->comment_id, 'ajax' => true)) . "'"));
            echo CHtml::ajaxButton('Delete', array('delete', 'ajax' => true), array(
                'type' => 'post',
                'data' => "chk[]={$model->id}",
                'success' => 'function(data){$(".controls").hide(); $(".content").html(data);}'
            ), array('class' => 'controls'));
        } else {
            echo CHtml::link('Manage', array('index'), array('class' => 'controls'));
            echo CHtml::link('Create', array('create'), array('class' => 'controls'));
            echo CHtml::link('Update', array('update', 'id' => $model->comment_id), array('class' => 'controls'));
            echo CHtml::link('Delete', array('delete'), array(
                'class' => 'controls', 
                'submit' => array('delete'), 
                'confirm'=>'Are you sure you want to delete this item?',
                'params' => array('chk[]' => $model->comment_id),
                'ajax' => array('type' => 'post')
            ));
        }
     ?>
    </div>
</div>

<div class="content">
<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'comment_id',
		'prod_id',
		'create_time',
		'context',
	),
)); ?>
</div>
